import request from "../request.js"

// 1- 生成确认订单
function addPreOrder(data){
	return request({
		url:"/lejuClient/order/addPreOrder",
		method: 'post',
		data
	})
}

// 2 - 根据订单id获取订单明细
function getPreOrderById(orderId){
	return request({
		url:`/lejuClient/order/getPreOrderById/${orderId}`
	})
}

// 3 - 提交确认订单
function addConfirmOrder(data){
	return request({
		url:"/lejuClient/order/addConfirmOrder",
		method: "post",
		data
	})
}

// 4 - 确认付款
function payConfirm(data){
	return request({
		url:`/lejuClient/order/payConfirm`,
		method: "post",
		data
	})
}

// 5 - 确认收货
function receiveDone(data){
	return request({
		url:`/lejuClient/order/receiveDone`,
		method: "post",
		data
	})
}

// 6 - 删除订单
function _clearOrderFocus(orderId){
	return request({
		url:`/lejuClient/order/_clearOrderFocus/?orderId=${orderId}`,
		method: "post"
	})
}

// 查询订单列表
function findAllOrders(){
	return request({
		url:`/lejuClient/order/findAllOrders`
	})
}


export {
	addPreOrder,
	getPreOrderById,
	addConfirmOrder,
	payConfirm,
	findAllOrders,
	receiveDone,
	_clearOrderFocus
}